package sentStruct;

import java.util.ArrayList;
import java.util.List;



public class Sentence {
	
	private List<Noun> subjects;
	private List<Noun> objects;
	private List<Verb> predicates;
	private List<Noun> prepositionObjects;
	private List<PartOfSpeech> tokens;
	private String text;
	
	public List<Noun> getSubjects() {
		return subjects;
	}
	public void setSubjects(List<Noun> subject) {
		this.subjects = subject;
	}
	public List<Noun> getObjects() {
		return objects;
	}
	public void setObjects(List<Noun> object) {
		this.objects = object;
	}
	public List<Verb> getVerbs() {
		return predicates;
	}
	public void setVerbs(List<Verb> verb) {
		this.predicates = verb;
	}
	public List<Noun> getPrepositionObjects() {
		return prepositionObjects;
	}
	public void setPrepositionObjects(List<Noun> other) {
		this.prepositionObjects = other;
	}
	public List<PartOfSpeech> getAllPartsOfSpeech(){
		return tokens;
	}
	public String getText() {
		return text;
	}
	public void setText(String text) {
		this.text = text;
	}
	public List<Noun> getNouns(){
		if (this.tokens==null) return new ArrayList<Noun>();
		List<Noun> listNoun = new ArrayList<Noun>();
		for (PartOfSpeech token : tokens)
			if (token.getClass().equals(Noun.class)) 
				listNoun.add((Noun)token);
		return listNoun;
			
			
   	
    }
  
	public List<PartOfSpeech> getAdjectivesAndAdverbs() {
		if (this.tokens==null) return new ArrayList<PartOfSpeech>();
		List<PartOfSpeech> list = new ArrayList<PartOfSpeech>();
		for (PartOfSpeech token : tokens)
			if (token.getClass().equals(Adjective.class)||token.getClass().equals(Adverb.class)) 
				list.add((PartOfSpeech)token);
		return list;
	}
	public List<PartOfSpeech> getTokens() {
		return tokens;
	}
	public void setTokens(List<PartOfSpeech> tokens) {
		this.tokens = tokens;
	}
	public void addToken(PartOfSpeech partOfspeech) {
		if (this.tokens==null)
			this.tokens = new ArrayList<PartOfSpeech>();
		tokens.add(partOfspeech);
			
	}
	public List<Pronoun> getPronouns(){
		if (this.tokens==null) return new ArrayList<Pronoun>();
		List<Pronoun> listPronoun = new ArrayList<Pronoun>();
		for (PartOfSpeech token : tokens)
			if (token.getClass().equals(Pronoun.class)) 
				listPronoun.add((Pronoun)token);
		return listPronoun;
			
			
   	
    }
 }
